#include <fstream>
#include <vector>
#include "2021QJSCOctaneV7.h"
#include "2021QJSCOctaneV9.h"
#include "WebfQJSCOctaneV7.h"
#include "WebfQJSCOctaneV9.h"

struct BCInfo {
  std::string name;
  const char *bc;
  uint32_t size;
};

std::vector<BCInfo> g_bcInfos = {
  {"originQJSCOctaneV7.bc", reinterpret_cast<const char*>(originQJSCOctaneV7), originQJSCOctaneV7Size},
  {"originQJSCOctaneV9.bc", reinterpret_cast<const char*>(originQJSCOctaneV9), originQJSCOctaneV9Size},

  {"webfQJSCOctaneV7.bc", reinterpret_cast<const char*>(webfQJSCOctaneV7), webfQJSCOctaneV7Size},
  {"webfQJSCOctaneV9.bc", reinterpret_cast<const char*>(webfQJSCOctaneV9), webfQJSCOctaneV9Size},
};

int main() {
  for (auto &bcInfo : g_bcInfos) {
    std::ofstream out(bcInfo.name, std::ios::binary);
    out.write(bcInfo.bc, bcInfo.size);
  }
  return 0;
}
